\(\int \frac {\sin (c+d x) \tan ^2(c+d x)}{(a+a \sin (c+d x))^2} \, dx\) [781]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F(-1)]
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 27, antiderivative size = 66 \[ \int \frac {\sin (c+d x) \tan ^2(c+d x)}{(a+a \sin (c+d x))^2} \, dx=\frac {\sec (c+d x)}{a^2 d}-\frac {\sec ^3(c+d x)}{a^2 d}+\frac {2 \sec ^5(c+d x)}{5 a^2 d}-\frac {2 \tan ^5(c+d x)}{5 a^2 d} \]

[Out]

sec(d*x+c)/a^2/d-sec(d*x+c)^3/a^2/d+2/5*sec(d*x+c)^5/a^2/d-2/5*tan(d*x+c)^5/a^2/d

Rubi [A] (verified)

Time = 0.20 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.00, number of steps used = 11, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.259, Rules used = {2954, 2952, 2686, 14, 2687, 30, 200} \[ \int \frac {\sin (c+d x) \tan ^2(c+d x)}{(a+a \sin (c+d x))^2} \, dx=-\frac {2 \tan ^5(c+d x)}{5 a^2 d}+\frac {2 \sec ^5(c+d x)}{5 a^2 d}-\frac {\sec ^3(c+d x)}{a^2 d}+\frac {\sec (c+d x)}{a^2 d} \]

[In]

Int[(Sin[c + d*x]*Tan[c + d*x]^2)/(a + a*Sin[c + d*x])^2,x]

[Out]

Sec[c + d*x]/(a^2*d) - Sec[c + d*x]^3/(a^2*d) + (2*Sec[c + d*x]^5)/(5*a^2*d) - (2*Tan[c + d*x]^5)/(5*a^2*d)

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 200

Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Int[ExpandIntegrand[(a + b*x^n)^p, x], x] /; FreeQ[{a, b}, x]
&& IGtQ[n, 0] && IGtQ[p, 0]

Rule 2686

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a/f, Subst[
Int[(a*x)^(m - 1)*(-1 + x^2)^((n - 1)/2), x], x, Sec[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n -
1)/2] &&  !(IntegerQ[m/2] && LtQ[0, m, n + 1])

Rule 2687

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[1/f, Subst[Int[(b*x)
^n*(1 + x^2)^(m/2 - 1), x], x, Tan[e + f*x]], x] /; FreeQ[{b, e, f, n}, x] && IntegerQ[m/2] &&  !(IntegerQ[(n
- 1)/2] && LtQ[0, n, m - 1])

Rule 2952

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_)*((a_) + (b_.)*sin[(e_.) + (f_.)*
(x_)])^(m_), x_Symbol] :> Int[ExpandTrig[(g*cos[e + f*x])^p, (d*sin[e + f*x])^n*(a + b*sin[e + f*x])^m, x], x]
 /; FreeQ[{a, b, d, e, f, g, n, p}, x] && EqQ[a^2 - b^2, 0] && IGtQ[m, 0]

Rule 2954

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_)*((a_) + (b_.)*sin[(e_.) + (f_.)*
(x_)])^(m_), x_Symbol] :> Dist[(a/g)^(2*m), Int[(g*Cos[e + f*x])^(2*m + p)*((d*Sin[e + f*x])^n/(a - b*Sin[e +
f*x])^m), x], x] /; FreeQ[{a, b, d, e, f, g, n, p}, x] && EqQ[a^2 - b^2, 0] && ILtQ[m, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {\int \sec ^3(c+d x) (a-a \sin (c+d x))^2 \tan ^3(c+d x) \, dx}{a^4} \\ & = \frac {\int \left (a^2 \sec ^3(c+d x) \tan ^3(c+d x)-2 a^2 \sec ^2(c+d x) \tan ^4(c+d x)+a^2 \sec (c+d x) \tan ^5(c+d x)\right ) \, dx}{a^4} \\ & = \frac {\int \sec ^3(c+d x) \tan ^3(c+d x) \, dx}{a^2}+\frac {\int \sec (c+d x) \tan ^5(c+d x) \, dx}{a^2}-\frac {2 \int \sec ^2(c+d x) \tan ^4(c+d x) \, dx}{a^2} \\ & = \frac {\text {Subst}\left (\int x^2 \left (-1+x^2\right ) \, dx,x,\sec (c+d x)\right )}{a^2 d}+\frac {\text {Subst}\left (\int \left (-1+x^2\right )^2 \, dx,x,\sec (c+d x)\right )}{a^2 d}-\frac {2 \text {Subst}\left (\int x^4 \, dx,x,\tan (c+d x)\right )}{a^2 d} \\ & = -\frac {2 \tan ^5(c+d x)}{5 a^2 d}+\frac {\text {Subst}\left (\int \left (1-2 x^2+x^4\right ) \, dx,x,\sec (c+d x)\right )}{a^2 d}+\frac {\text {Subst}\left (\int \left (-x^2+x^4\right ) \, dx,x,\sec (c+d x)\right )}{a^2 d} \\ & = \frac {\sec (c+d x)}{a^2 d}-\frac {\sec ^3(c+d x)}{a^2 d}+\frac {2 \sec ^5(c+d x)}{5 a^2 d}-\frac {2 \tan ^5(c+d x)}{5 a^2 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.64 (sec) , antiderivative size = 84, normalized size of antiderivative = 1.27 \[ \int \frac {\sin (c+d x) \tan ^2(c+d x)}{(a+a \sin (c+d x))^2} \, dx=\frac {\sec (c+d x) (40-65 \cos (c+d x)-8 \cos (2 (c+d x))+13 \cos (3 (c+d x))+40 \sin (c+d x)-52 \sin (2 (c+d x))+8 \sin (3 (c+d x)))}{80 a^2 d (1+\sin (c+d x))^2} \]

[In]

Integrate[(Sin[c + d*x]*Tan[c + d*x]^2)/(a + a*Sin[c + d*x])^2,x]

[Out]

(Sec[c + d*x]*(40 - 65*Cos[c + d*x] - 8*Cos[2*(c + d*x)] + 13*Cos[3*(c + d*x)] + 40*Sin[c + d*x] - 52*Sin[2*(c
 + d*x)] + 8*Sin[3*(c + d*x)]))/(80*a^2*d*(1 + Sin[c + d*x])^2)

Maple [A] (verified)

Time = 0.28 (sec) , antiderivative size = 61, normalized size of antiderivative = 0.92

method result size
parallelrisch \(\frac {-\frac {4}{5}-4 \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {16 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{5}}{d \,a^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{5}}\) \(61\)
risch \(\frac {4 i {\mathrm e}^{4 i \left (d x +c \right )}+2 \,{\mathrm e}^{5 i \left (d x +c \right )}-4 \,{\mathrm e}^{3 i \left (d x +c \right )}-\frac {4 i}{5}-\frac {6 \,{\mathrm e}^{i \left (d x +c \right )}}{5}}{\left ({\mathrm e}^{i \left (d x +c \right )}+i\right )^{5} \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) d \,a^{2}}\) \(85\)
derivativedivides \(\frac {-\frac {1}{4 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {4}{5 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{5}}-\frac {2}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{4}}+\frac {1}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{3}}+\frac {1}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}+\frac {16}{64 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+64}}{d \,a^{2}}\) \(100\)
default \(\frac {-\frac {1}{4 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {4}{5 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{5}}-\frac {2}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{4}}+\frac {1}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{3}}+\frac {1}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}+\frac {16}{64 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+64}}{d \,a^{2}}\) \(100\)
norman \(\frac {-\frac {4 \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d a}-\frac {4}{5 a d}-\frac {16 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{5 d a}-\frac {24 \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{5 d a}-\frac {16 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{5 d a}}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{5} a \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\) \(129\)

[In]

int(sec(d*x+c)^2*sin(d*x+c)^3/(a+a*sin(d*x+c))^2,x,method=_RETURNVERBOSE)

[Out]

4/5*(-1-5*tan(1/2*d*x+1/2*c)^2-4*tan(1/2*d*x+1/2*c))/d/a^2/(tan(1/2*d*x+1/2*c)-1)/(tan(1/2*d*x+1/2*c)+1)^5

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.15 \[ \int \frac {\sin (c+d x) \tan ^2(c+d x)}{(a+a \sin (c+d x))^2} \, dx=\frac {\cos \left (d x + c\right )^{2} - 2 \, {\left (\cos \left (d x + c\right )^{2} + 1\right )} \sin \left (d x + c\right ) - 3}{5 \, {\left (a^{2} d \cos \left (d x + c\right )^{3} - 2 \, a^{2} d \cos \left (d x + c\right ) \sin \left (d x + c\right ) - 2 \, a^{2} d \cos \left (d x + c\right )\right )}} \]

[In]

integrate(sec(d*x+c)^2*sin(d*x+c)^3/(a+a*sin(d*x+c))^2,x, algorithm="fricas")

[Out]

1/5*(cos(d*x + c)^2 - 2*(cos(d*x + c)^2 + 1)*sin(d*x + c) - 3)/(a^2*d*cos(d*x + c)^3 - 2*a^2*d*cos(d*x + c)*si
n(d*x + c) - 2*a^2*d*cos(d*x + c))

Sympy [F(-1)]

Timed out. \[ \int \frac {\sin (c+d x) \tan ^2(c+d x)}{(a+a \sin (c+d x))^2} \, dx=\text {Timed out} \]

[In]

integrate(sec(d*x+c)**2*sin(d*x+c)**3/(a+a*sin(d*x+c))**2,x)

[Out]

Timed out

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 164 vs. \(2 (62) = 124\).

Time = 0.22 (sec) , antiderivative size = 164, normalized size of antiderivative = 2.48 \[ \int \frac {\sin (c+d x) \tan ^2(c+d x)}{(a+a \sin (c+d x))^2} \, dx=\frac {4 \, {\left (\frac {4 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {5 \, \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + 1\right )}}{5 \, {\left (a^{2} + \frac {4 \, a^{2} \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {5 \, a^{2} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac {5 \, a^{2} \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} - \frac {4 \, a^{2} \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} - \frac {a^{2} \sin \left (d x + c\right )^{6}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{6}}\right )} d} \]

[In]

integrate(sec(d*x+c)^2*sin(d*x+c)^3/(a+a*sin(d*x+c))^2,x, algorithm="maxima")

[Out]

4/5*(4*sin(d*x + c)/(cos(d*x + c) + 1) + 5*sin(d*x + c)^2/(cos(d*x + c) + 1)^2 + 1)/((a^2 + 4*a^2*sin(d*x + c)
/(cos(d*x + c) + 1) + 5*a^2*sin(d*x + c)^2/(cos(d*x + c) + 1)^2 - 5*a^2*sin(d*x + c)^4/(cos(d*x + c) + 1)^4 -
4*a^2*sin(d*x + c)^5/(cos(d*x + c) + 1)^5 - a^2*sin(d*x + c)^6/(cos(d*x + c) + 1)^6)*d)

Giac [A] (verification not implemented)

none

Time = 0.33 (sec) , antiderivative size = 94, normalized size of antiderivative = 1.42 \[ \int \frac {\sin (c+d x) \tan ^2(c+d x)}{(a+a \sin (c+d x))^2} \, dx=-\frac {\frac {5}{a^{2} {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1\right )}} - \frac {5 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 30 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 80 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 50 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 11}{a^{2} {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )}^{5}}}{20 \, d} \]

[In]

integrate(sec(d*x+c)^2*sin(d*x+c)^3/(a+a*sin(d*x+c))^2,x, algorithm="giac")

[Out]

-1/20*(5/(a^2*(tan(1/2*d*x + 1/2*c) - 1)) - (5*tan(1/2*d*x + 1/2*c)^4 + 30*tan(1/2*d*x + 1/2*c)^3 + 80*tan(1/2
*d*x + 1/2*c)^2 + 50*tan(1/2*d*x + 1/2*c) + 11)/(a^2*(tan(1/2*d*x + 1/2*c) + 1)^5))/d

Mupad [B] (verification not implemented)

Time = 11.07 (sec) , antiderivative size = 111, normalized size of antiderivative = 1.68 \[ \int \frac {\sin (c+d x) \tan ^2(c+d x)}{(a+a \sin (c+d x))^2} \, dx=\frac {\frac {4\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6}{5}+\frac {16\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{5}+4\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{a^2\,d\,\left (\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )-\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,{\left (\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )+\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}^5} \]

[In]

int(sin(c + d*x)^3/(cos(c + d*x)^2*(a + a*sin(c + d*x))^2),x)

[Out]

((4*cos(c/2 + (d*x)/2)^6)/5 + (16*cos(c/2 + (d*x)/2)^5*sin(c/2 + (d*x)/2))/5 + 4*cos(c/2 + (d*x)/2)^4*sin(c/2
+ (d*x)/2)^2)/(a^2*d*(cos(c/2 + (d*x)/2) - sin(c/2 + (d*x)/2))*(cos(c/2 + (d*x)/2) + sin(c/2 + (d*x)/2))^5)